<template>
    <div class="accountOperationLog">
        <div class="header flexbetween mb20">
            <div style="display: flex">
                <el-radio-group v-model="time" size="small" class="mr20" @change="radioTimeChange">
                    <el-radio-button label="0">今天</el-radio-button>
                    <el-radio-button label="1">昨天</el-radio-button>
                    <el-radio-button label="7">近一周</el-radio-button>
                    <el-radio-button label="30">近30天</el-radio-button>
                </el-radio-group>
                <el-date-picker v-model="date" size="small" type="datetimerange" start-placeholder="开始日期" end-placeholder="结束日期"
                                value-format="yyyy-MM-dd HH:mm:ss" @change="dateRangeChange" :default-time="['00:00:00', '23:59:59']">
                </el-date-picker>
            </div>
        </div>
        <element-table :data="logList" :columns="cloumns" :tableHeight="tableHeight" :pageNo="pageNo" :pageSize="pageSize" :total="total"
                       @changePageNo="changePageNo" @changePageSize="changePageSize">
        </element-table>
    </div>
</template>

<script>
import elementTable from "@/components/elementTable";
import { initFilterTime } from "@/utils/index";
export default {
    name: "accountOperationLog",
    data() {
        return {
            time: "0",
            date: "",
            logList: [],
            pageNo: 1,
            pageSize: 10,
            total: 0,
            cloumns: [
                {
                    config: {
                        label: "操作人姓名",
                        prop: "time"
                    },
                },
                {
                    config: {
                        label: "模块",
                        prop: "time"
                    },
                },
                {
                    config: {
                        label: "操作内容",
                        prop: "time"
                    },
                },
                {
                    config: {
                        label: "操作时间",
                        prop: "time"
                    },
                },
                {
                    config: {
                        label: "状态",
                        prop: "time"
                    },
                },
            ],
        }
    },
    methods: {
        radioTimeChange(val) {
            this.date = initFilterTime(val);
        },
        dateRangeChange(val) {
            this.time = "";
            if (!val) {
                this.$antMessage.warning("请选择日期");
            } else {

            }
        },
        changePageSize(val) {
            this.pageSize = val;
        },
        changePageNo(val) {
            this.pageNo = val;
        },
    },
    created() {
        this.date = initFilterTime(0);
    },
    computed: {
        tableHeight() {
            return document.body.clientHeight - 240;
        },
    },
    components: {
        elementTable
    }
}
</script>

<style lang="scss">
</style>